package com.palmap.controller;

import com.palmap.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangxinju
 * @since 2020/5/7 1:41 下午
 */
@RestController
@RequestMapping("/filter")
public class FilterController {
    @GetMapping("/error")
    public Map<String, String> requestFailed() {

        Map<String, String> map = new HashMap<>();
        map.put("code", "-1");
        map.put("msg", "请求错误");
        return map;
    }

    @GetMapping("/success/info")
    public User userInfo() {
        User user = new User();
        user.setUsername("william");
        user.setPassword("");
        user.setNickname("joanne");
        user.setGender("女");
        user.setAge("1");
        return user;
    }
}
